const koa = require("koa");
const app = new koa();
const BodyParser = require("koa-bodyparser");
const login = require("./route/user");
const route = require('./route/index')
const doctor = require('./route/doctor')

const cors = require("koa2-cors");



app.use(cors()); // 解决跨域问题
app.use(BodyParser());
app.use(login.routes(), login.allowedMethods());
app.use(doctor.routes(), doctor.allowedMethods());
app.use(route.routes(), route.allowedMethods());

app.listen(8080, () => {
  console.log("8080端口启动成功");
});
